﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.ConfigForm.Children
{
    public partial class TabAppearance : Krilib.Control.ConfigPage
    {
        public TabAppearance()
        {
            InitializeComponent();
        }

        private void TabAppearance_Load(object sender, EventArgs e)
        {
            MaxSizeW.Value = Core.Config.Appearance.TabAppearance.MaxSize.Width;
            MaxSizeH.Value = Core.Config.Appearance.TabAppearance.MaxSize.Height;
            FixedSize.Checked = Core.Config.Appearance.TabAppearance.FixedSize;
            UseMultiline.Checked = Core.Config.Appearance.TabAppearance.UseMultiline;
            ShowCloseButtonForAllTab.Checked = Core.Config.Appearance.TabAppearance.ShowCloseButtonForAllTab;
            ShowTabListButton.Checked = Core.Config.Appearance.TabAppearance.ShowTabListButton;
            ATLTabName.Text = Core.Config.Appearance.TabAppearance.ATLTabName;
        }

        public override void Apply()
        {
            Core.Config.Appearance.TabAppearance.MaxSize = new Size(
                (int)MaxSizeW.Value, (int)MaxSizeH.Value);
            Core.Config.Appearance.TabAppearance.FixedSize = FixedSize.Checked;
            Core.Config.Appearance.TabAppearance.UseMultiline = UseMultiline.Checked;
            Core.Config.Appearance.TabAppearance.ShowCloseButtonForAllTab = ShowCloseButtonForAllTab.Checked;
            Core.Config.Appearance.TabAppearance.ShowTabListButton = ShowTabListButton.Checked;
            Core.Config.Appearance.TabAppearance.ATLTabName = ATLTabName.Text;
            base.Apply();
        }
    }
}
